package com.yyq.adms.usermanage.pojo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.yyq.sos.pojo.BackBaseEntity;

@Entity
@Table(name = "ss_sys_users_roles")
public class SysUsersRoles extends BackBaseEntity implements java.io.Serializable
{
	private static final long serialVersionUID = -1717982070359870134L;
	private Long userId;
	private Long roleId;
	private String isGrant = "0";//默认不允许该用户具有该角色的授权功能，1为允许。
	private Long grantor = new Long(1);
	private Date grantDate = new Date();
	

	public SysUsersRoles()
	{
		
	}

	public SysUsersRoles(Long userRoleId, Long userId, Long roleId)
	{
		this.id = userRoleId;
		this.userId = userId;
		this.roleId = roleId;
	}

	@Column(name = "user_id")
	public Long getUserId()
	{
		return this.userId;
	}

	public void setUserId(Long userId)
	{
		this.userId = userId;
	}

	@Column(name = "role_id")
	public Long getRoleId()
	{
		return this.roleId;
	}

	public void setRoleId(Long roleId)
	{
		this.roleId = roleId;
	}
	
	public String toString() {
		StringBuffer str = new StringBuffer();
		str.append("\r\n主键="+this.id);
		str.append("\r\n;用户ID="+this.userId);
		str.append("\r\n;角色ID="+this.roleId);
		str.append("\r\n;是否允许授权="+this.isGrant);
		str.append("\r\n;授权人ID="+this.grantor);
		str.append("\r\n;授权时间="+this.grantDate);
		return str.toString();
	}

	@Column(name = "is_grant")
	public String getIsGrant() {
		return isGrant;
	}

	public void setIsGrant(String isGrant) {
		this.isGrant = isGrant;
	}

	@Column(name = "grantor")
	public Long getGrantor() {
		return grantor;
	}

	public void setGrantor(Long grantor) {
		this.grantor = grantor;
	}

	@Column(name = "grant_date")
	public Date getGrantDate() {
		return grantDate;
	}

	public void setGrantDate(Date grantDate) {
		this.grantDate = grantDate;
	}
}